package net;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.net.Socket;

public class Receiver1 extends Thread {
    private Socket socket;

    public Receiver1(Socket socket) {
        this.socket = socket;
    }

    @Override
    public void run() {
        try {
            InputStreamReader isr=new InputStreamReader(socket.getInputStream());
            BufferedReader br=new BufferedReader(isr);
            String s=br.readLine();
            while (!s.equals("bye")){
                System.out.println(s);
                s=br.readLine();
            }
        } catch (IOException e) {
            e.printStackTrace();
        }
    }
}
